﻿using System;
using System.ComponentModel;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace ListProvisioning.TeamMembersWebPart
{
    [ToolboxItemAttribute(false)]
    public class TeamMembersWebPart : WebPart
    {
        protected override void CreateChildControls()
        {
            SPList list = SPContext.Current.Site.GetCatalog(
                SPListTemplateType.UserInformation);
            Controls.Add(new ListViewByQuery
            {
                List = list,
                Query = new SPQuery(list.DefaultView)
            });
            ChildControlsCreated = true;
        }
    }
}
